package com.clkj.goldpartner.dao;

import com.clkj.goldpartner.pojo.OutStock;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author 杨行
 * @date 2021/3/2 14:02
 */
@Repository
public interface OutStockMapper extends Mapper<OutStock> {

    /**
     * 获取最后一位编号
     *
     * @return String
     */
    @Select("select top 1 out_num from t_cl_outStock group by outStock_id,out_num  order by outStock_id desc")
    String getOut_num();

    /**
     * 获取不同状态的出货单
     *
     * @param shop_id
     * @param out_status
     * @return List<OutStock>
     */
    @Select("select * from t_cl_outStock where shop_id = #{shop_id} and out_status in (${out_status})")
    List<OutStock> getOutStock(Integer shop_id, String out_status);
}